package com.ysg.sportsportlsit.service.impl;

import com.ysg.common.utils.DateUtils;
import com.ysg.sportsportlsit.domain.SportsInformation;
import com.ysg.sportsportlsit.mapper.SportsInformationMapper;
import com.ysg.sportsportlsit.service.ISportsInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 运动会届Service业务层处理
 * 
 * @author 叶双贵
 * @date 2022-03-24
 */
@Service
public class SportsInformationServiceImpl implements ISportsInformationService
{
    @Autowired
    private SportsInformationMapper sportsInformationMapper;

    /**
     * 查询运动会届
     * 
     * @param sportId 运动会届主键
     * @return 运动会届
     */
    @Override
    public SportsInformation selectSportsInformationBySportId(String sportId)
    {
        return sportsInformationMapper.selectSportsInformationBySportId(sportId);
    }

    /**
     * 查询运动会届列表
     * 
     * @param sportsInformation 运动会届
     * @return 运动会届
     */
    @Override
    public List<SportsInformation> selectSportsInformationList(SportsInformation sportsInformation)
    {
        return sportsInformationMapper.selectSportsInformationList(sportsInformation);
    }

    /**
     * 新增运动会届
     * 
     * @param sportsInformation 运动会届
     * @return 结果
     */
    @Override
    public int insertSportsInformation(SportsInformation sportsInformation)
    {
        sportsInformation.setCreateTime(DateUtils.getNowDate());
        return sportsInformationMapper.insertSportsInformation(sportsInformation);
    }

    /**
     * 修改运动会届
     * 
     * @param sportsInformation 运动会届
     * @return 结果
     */
    @Override
    public int updateSportsInformation(SportsInformation sportsInformation)
    {
        sportsInformation.setUpdateTime(DateUtils.getNowDate());
        return sportsInformationMapper.updateSportsInformation(sportsInformation);
    }

    /**
     * 批量删除运动会届
     * 
     * @param sportIds 需要删除的运动会届主键
     * @return 结果
     */
    @Override
    public int deleteSportsInformationBySportIds(String[] sportIds)
    {
        return sportsInformationMapper.deleteSportsInformationBySportIds(sportIds);
    }

    /**
     * 删除运动会届信息
     * 
     * @param sportId 运动会届主键
     * @return 结果
     */
    @Override
    public int deleteSportsInformationBySportId(String sportId)
    {
        return sportsInformationMapper.deleteSportsInformationBySportId(sportId);
    }
}
